/*
 * seed.c
 */

#include <stdint.h>

#include "seed.h"
#include "err.h"

extern void SeedEncrypt(uint8_t *pbData, uint32_t *pdwRoundKey);
    
extern void SeedDecrypt(uint8_t *pbData, uint32_t *pdwRoundKey);
    
extern void SeedRoundKey(uint32_t *pdwRoundKey, uint8_t *pbUserKey);


void seed_expand_encryption_key(const v128_t *key, seed_expanded_key_t expanded_key)
{
	SeedRoundKey((uint32_t *)expanded_key, (uint8_t *)key);
}

void seed_expand_decryption_key(const v128_t *key, seed_expanded_key_t expanded_key)
{
	SeedRoundKey((uint32_t *)expanded_key, (uint8_t *)key);
}

void seed_encrypt(v128_t *plaintext, const seed_expanded_key_t exp_key)
{
	SeedEncrypt((uint8_t *)plaintext, (uint32_t *)exp_key);
}

void seed_decrypt(v128_t *ciphertext, const seed_expanded_key_t exp_key)
{
	SeedDecrypt((uint8_t *)ciphertext, (uint32_t *)exp_key);
}

